#!/bin/bash

cd ../bin
export LD_LIBRARY_PATH=.

# --------------- SERVER ------------------
gnome-terminal --geometry=84x20+50+50 -e "./htreed --psplugin=../plugins/libplgservicefile.so"&
pid=$!
sleep 1

# --------------- Test1 ------------------
gnome-terminal --geometry=84x20+100+100 -e ./htr_test1_sharedimage&
pid="$pid $!"
sleep 1

gnome-terminal --geometry=84x20+150+150 -e ./htr_test1_sharedimage&
pid="$pid $!"
sleep 1

# --------------- Test2 ------------------
gnome-terminal --geometry=84x20+200+250 -e ./htr_test2_c_client&
pid="$pid $!"
sleep 1

gnome-terminal --geometry=84x20+250+350 -e ./htr_test2_slider&
pid="$pid $!"
sleep 1

gnome-terminal --geometry=84x20+250+370 -e ./htr_test3_chat&
pid="$pid $!"
sleep 1

gnome-terminal --geometry=84x20+300+400 -e ./htr_commander&
pid="$pid $!"
sleep 1

# gnome-terminal --geometry=84x20+300+500 -e ./htr_landscape&
# pid="$pid $!"
# sleep 1

trap 'echo SHUTDOWN && kill $pid' INT
echo Warte auf beenden der Prozesse..
wait $pid
echo Test beendet.
